package com.schoolgard.entitybean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "ROLE_OF_USERS")
@SequenceGenerator (name="AUTO_ID", sequenceName="AUTO_ID")
public class RoleOfUsers implements java.io.Serializable {

	private static final long serialVersionUID = 201202262112L;

	private Long id;
	private String roleIds;
	private Users users;
	private String enable;

	@Id
	@Column(name = "ID", unique = true, nullable = false, precision = 10, scale = 0)
	@GeneratedValue (strategy=GenerationType.SEQUENCE, generator="AUTO_ID")
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "ROLE_ID", nullable = false)
	public String getRole() {
		return this.roleIds;
	}

	public void setRole(String roleIds) {
		this.roleIds = roleIds;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "USERS_ID", nullable = false)
	public Users getUsers() {
		return this.users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	@Column(name = "ENABLE", length = 1)
	public String getEnable() {
		return this.enable;
	}

	public void setEnable(String enable) {
		this.enable = enable;
	}

}